"""
生成测试报告的代码
"""
import unittest
import app
from lib.HTMLTestRunner2 import HTMLTestRunner
from script.test_ihrm_login_params import TestIhrmLoginParams


# 创建测试套件类的实例
suite = unittest.TestSuite()

# 组装测试用例到测试套件中
suite.addTest(unittest.makeSuite(TestIhrmLoginParams))

# 拼接生成的测试报告路径及名称
reportername = app.BASE_DIR + "/report/myReport.html"

# 打开测试报告文件，以wb形式写入报告内容
with open(reportername, 'wb') as f :
    runner = HTMLTestRunner(f)
    runner.run(suite)